import EventBus from './eventBus'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import MixinStore from '@/stores/MixinStore.vue'
import { ElMessage } from 'element-plus'

/**
 * 混入到 vue 中，例如自定义指令等
 */
export default {
  install(Vue) {
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      Vue.component(key, component)
    }
    Vue.mixin(MixinStore)
    Vue.use(ElementPlus)
    Vue.config.productionTip = false
    Vue.config.globalProperties.$message = ElMessage
    Vue.config.globalProperties.$bus = EventBus
  },
}
